﻿using System;
using System.Diagnostics;
using System.Reflection;
using System.Windows.Forms;

namespace CnSharp.SSMS.Demo
{
    public partial class AboutForm : Form
    {
        public AboutForm()
        {
            InitializeComponent();
            lblVersion.Text = ProductVersion;
            lblCopyright.Text = AssemblyCopyright;
        }

        public string AssemblyCopyright
        {
            get
            {
                var attributes =
                    Assembly.GetExecutingAssembly().GetCustomAttributes(typeof (AssemblyCopyrightAttribute), false);
                if (attributes.Length == 0)
                    return "";
                return ((AssemblyCopyrightAttribute) attributes[0]).Copyright;
            }
        }


        private void FormAbout_MouseClick(object sender, MouseEventArgs e)
        {
            DialogResult = DialogResult.OK;
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            OpenWeb();
        }

        private void OpenWeb()
        {
            Process.Start("http://ssmssharp.codeplex.com/");
            DialogResult = DialogResult.OK;
        }

        private void AboutForm_Load(object sender, EventArgs e)
        {
            
        }

       
       
    }
}